home *** CD-ROM | disk | FTP | other *** search
/ Aminet 22 / Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso / Aminet / dev / src / ConfigFileSrc.lha / ConfigFileSrc12 / Library / Funcs / Remove.c < prev    next >
Encoding:
Text File  |  1997-10-02  |  2.9 KB  |  131 lines

  1. /*
  2. **        $PROJECT: ConfigFile.library
  3. **        $FILE: Remove.c
  4. **        $DESCRIPTION: cf_Remove#?() functions
  5. **
  6. **        (C) Copyright 1996-1997 Marcel Karas
  7. **             All Rights Reserved.
  8. */
  9.  
  10. IMPORT struct ExecBase    * SysBase;
  11.  
  12. /****** configfile.library/cf_RemoveArgument *********************************
  13. *
  14. *   NAME
  15. *        cf_RemoveArgument -- Remove an argument node.
  16. *
  17. *   SYNOPSIS
  18. *        cf_RemoveArgument(ArgNode);
  19. *                          A0
  20. *
  21. *        VOID cf_RemoveArgument(CFArgument *);
  22. *
  23. *   FUNCTION
  24. *        This function remove an argument node. Note don't adds the removed
  25. *        ArgNode to another open CF file.
  26. *
  27. *   INPUTS
  28. *        ArgNode - The argument node to remove.
  29. *
  30. *   SEE ALSO
  31. *        cf_RemoveGroup(), cf_RemoveItem()
  32. *
  33. ******************************************************************************
  34. *
  35. */
  36.  
  37. LibCall VOID cf_RemoveArgument ( REGA0 iCFArgument * ArgNode )
  38. {
  39.     FuncDe(bug("cf_RemoveArgument($%08lx)\n{\n", ArgNode));
  40.  
  41.     if ( !( ArgNode->ExtFlags & CF_EFLG_REMOVED ) )
  42.     {
  43.         Remove ((struct Node *) ArgNode);
  44.  
  45.         ArgNode->ExtFlags                        |= CF_EFLG_REMOVED;
  46.         ArgNode->GrpNode->Header->Flags    |= CF_HFLG_CHANGED;
  47.     }
  48.  
  49.     FuncDe(bug("}\n"));
  50. }
  51.  
  52. /****** configfile.library/cf_RemoveGroup ************************************
  53. *
  54. *   NAME
  55. *        cf_RemoveGroup -- Remove a group node.
  56. *
  57. *   SYNOPSIS
  58. *        cf_RemoveGroup(GrpNode);
  59. *                       A0
  60. *
  61. *        VOID cf_RemoveGroup(CFGroup *);
  62. *
  63. *   FUNCTION
  64. *        This function remove a group node. Note don't adds the removed 
  65. *        GrpNode to another open CF file.
  66. *
  67. *   INPUTS
  68. *        GrpNode - The group node to remove.
  69. *
  70. *   SEE ALSO
  71. *        cf_RemoveArgument(), cf_RemoveItem()
  72. *
  73. ******************************************************************************
  74. *
  75. */
  76.  
  77. LibCall VOID cf_RemoveGroup ( REGA0 iCFGroup * GrpNode )
  78. {
  79.     FuncDe(bug("cf_RemoveGroup($%08lx)\n{\n", GrpNode));
  80.  
  81.     if ( !( GrpNode->ExtFlags & CF_EFLG_REMOVED ) )
  82.     {
  83.         Remove ((struct Node *) GrpNode);
  84.  
  85.         GrpNode->ExtFlags         |= CF_EFLG_REMOVED;
  86.         GrpNode->Header->Flags    |= CF_HFLG_CHANGED;
  87.     }
  88.  
  89.     FuncDe(bug("}\n"));
  90. }
  91.  
  92. /****** configfile.library/cf_RemoveItem *************************************
  93. *
  94. *   NAME
  95. *        cf_RemoveItem -- Remove an item node.
  96. *
  97. *   SYNOPSIS
  98. *        cf_RemoveItem(ItemNode);
  99. *                      A0
  100. *
  101. *        VOID cf_RemoveItem(CFItem *);
  102. *
  103. *   FUNCTION
  104. *        This function remove an item node. Note don't adds the removed 
  105. *        ItemNode to another open CF file.
  106. *
  107. *   INPUTS
  108. *        ItemNode - The item node to remove.
  109. *
  110. *   SEE ALSO
  111. *        cf_RemoveGroup(), cf_RemoveArgument()
  112. *
  113. ******************************************************************************
  114. *
  115. */
  116.  
  117. LibCall VOID cf_RemoveItem ( REGA0 iCFItem * ItemNode )
  118. {
  119.     FuncDe(bug("cf_RemoveItem($%08lx)\n{\n", ItemNode));
  120.  
  121.     if ( !( ItemNode->ExtFlags & CF_EFLG_REMOVED ) )
  122.     {
  123.         Remove ((struct Node *) ItemNode);
  124.  
  125.         ItemNode->ExtFlags                                |= CF_EFLG_REMOVED;
  126.         ItemNode->ArgNode->GrpNode->Header->Flags    |= CF_HFLG_CHANGED;
  127.     }
  128.  
  129.     FuncDe(bug("}\n"));
  130. }
  131.